package org.xserver.component.redis.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("all")
public class RedisConstant {

	/** SUCCESS */
	public static final Integer TOKEN_SUCCESS = 10000;
	/** OVERDUE */
	public static final Integer TOKEN_OVERDUE = 10001;
	/** ERROE */
	public static final Integer TOKEN_ERROE = 10002;
	/** NULL */
	public static final Integer TOKEN_NULL = 10003;
	/** SYSERROR */
	public static final Integer TOKEN_SYSERROR = 10004;

	public static final String ACCESS_TOKEN = "ACCESS_TOKEN";

	public static final String USER_ID = "USER_ID";

	public static final String CREATE_TIME = "CREATE_TIME";

	public static final String TRANDE_USER_INFO = "TRADE_USER_INFO";
	
	public static final String TRANDE_INFO_BUY = "TRADE_INFO_BUY";
	public static final String TRANDE_INFO_SELL = "TRADE_INFO_SELL";
	
	public static final String   KEYS = "TRADE_INFO_SELL";
	
	public static Date parser(String dateStr, String pattern) {
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		try {
			return sdf.parse(dateStr);
		} catch (Exception e) {
			return null;
		}
	}
	public static final String DF_yyyyMMddHHmmss = "yyyyMMddHHmmss";
	public static final String TOKEN_ERROE_MSG = " token error";



	/** token过期时间:分钟 */
	public static Integer accessTokenTimeout;
	/** token保存的时间:分钟 */
	private Integer accessTokenTimeHistory;

	public Integer getAccessTokenTimeHistory() {
		return accessTokenTimeHistory;
	}

	public void setAccessTokenTimeHistory(Integer accessTokenTimeHistory) {
		this.accessTokenTimeHistory = accessTokenTimeHistory;
	}

	public Integer getAccessTokenTimeout() {
		return accessTokenTimeout;
	}

	public void setAccessTokenTimeout(Integer accessTokenTimeout) {
		this.accessTokenTimeout = accessTokenTimeout;
	}
}
